using Microsoft.VisualStudio.TestTools.UnitTesting;

namespace Be.Timvw.Framework.Tests.EnumHelper
{
    [TestClass]
    public class WhenTryParsing
    {
        [TestMethod]
        public void ShouldReturnDomainTypeWhenValidInput()
        {
            string input = "Consumer";

            DomainType actualDomainType;
            bool actualReturnValue = Be.Timvw.Framework.EnumHelper.TryParse(input, out actualDomainType);

            DomainType expectedDomainType = DomainType.Consumer;

            Assert.IsTrue(actualReturnValue);
            Assert.AreEqual(expectedDomainType, actualDomainType);
        }

        [TestMethod]
        public void ShouldReturnFalseWhenInvalidInput()
        {
            string input = "Invalid";

            DomainType actualDomainType;
            bool actualReturnValue = Be.Timvw.Framework.EnumHelper.TryParse(input, out actualDomainType);

            Assert.IsFalse(actualReturnValue);
        }
    }
}